From: Alessandro Bono Date: Mon, 16 Jan 2023 20:41:24 +0000 (+0100) Subject: accessDialog: Don't add an empty body X-Git-Tag: archive/raspbian/50.5-1+rpi1~1^2~405^2^2~169 X-Git-Url: https://dgit.raspbian.org/%22http://www.example.com/cgi/%22/%22http:/www.example.com/cgi/%22?a=commitdiff_plain;h=771b3bada292fb43d78056e12d145da5a4dd5b90;p=gnome-shell.git accessDialog: Don't add an empty body According to the org.freedesktop.impl.portal.Access documentation the body may be an empty string[1]. Take into account this case. [1] https://github.com/flatpak/xdg-desktop-portal/blob/d7cfc16a6dc11cb925116fe36c5ee23e7075849c/data/org.freedesktop.impl.portal.Access.xml#L38 Part-of: --- diff --git a/js/ui/accessDialog.js b/js/ui/accessDialog.js index fba2521fd..1e296079c 100644 --- a/js/ui/accessDialog.js +++ b/js/ui/accessDialog.js @@ -58,13 +58,15 @@ class AccessDialog extends ModalDialog.ModalDialog { this._choices.set(id, check); } - let bodyLabel = new St.Label({ - text: body, - x_align: Clutter.ActorAlign.CENTER, - }); - bodyLabel.clutter_text.ellipsize = Pango.EllipsizeMode.NONE; - bodyLabel.clutter_text.line_wrap = true; - content.add_child(bodyLabel); + if (body) { + let bodyLabel = new St.Label({ + text: body, + x_align: Clutter.ActorAlign.CENTER, + }); + bodyLabel.clutter_text.ellipsize = Pango.EllipsizeMode.NONE; + bodyLabel.clutter_text.line_wrap = true; + content.add_child(bodyLabel); + } this.addButton({ label: denyLabel,